package models

import (
	"github.com/goravel/framework/database/orm"
)

type Role struct {
	orm.Model
	Name   string `gorm:"type:varchar(100);not null;" json:"name"`
	Status uint8  `gorm:"type:tinyint(1);default:1;not null;" json:"status"`
	Menus  []Menu `gorm:"many2many:go_role_menu;joinForeignKey:role_id;joinReferences:menu_id" json:"menus"`
}

func (receiver *Role) TableName() string {
	return "go_role"
}
